ServerEvents.recipes(event =>{
    const firmalife = event.recipes.firmalife
    const tfc = event.recipes.tfc
    const create = event.recipes.create
    firmalife.drying('tfc:food/dried_kelp','tfc:plant/leafy_kelp'),
    firmalife.drying('tfc:food/dried_kelp','tfc:plant/winged_kelp')
    event.remove({output:'minecraft:leather',type:'create:milling'})
    event.remove({output:'minecraft:leather',type:'create:crushing'})
    event.replaceInput({output:"#tfc:gear_boxes"},'tfc:brass_mechanisms','#minecraft:planks')
    event.replaceInput({output:"#tfc:gear_boxes"},'#tfc:lumber','enderio:stone_gear')
    tfc.damage_inputs_shapeless_crafting(event.shapeless('3x firmalife:treated_lumber',['#tfc:saws','immersiveengineering:treated_wood_horizontal']))
    event.shaped('2x tfc:handstone',['A  ','BBB'],{A:"#forge:rods/wooden",B:"#forge:stone_bricks"})
    event.shapeless('tfc:quern','9x #tfc:rock/raw')
    //烧盐水出盐
    firmalife.vat()
    .inputFluid(Fluid.of('tfc:salt_water',10000))
    .outputItem(Item.of("tfc:powder/salt",16))
    .outputFluid(Fluid.water(8000))
    .temperature(110)
    .length(1800)
    event.custom(
        {"type":"tfc:pot",
        "ingredients":[],
        "fluid_ingredient":{"ingredient":"tfc:salt_water","amount":1000},
        "duration":600,"temperature":101,
        "fluid_output":{"fluid":"minecraft:water","amount":800},
        "item_output":[{"item":"tfc:powder/salt"},{"item":"tfc:powder/salt"}]
    })
    //烧树汁出树脂
    firmalife.vat()
    .inputFluid(Fluid.of('thermal:sap',1000))
    .outputItem(Item.of("anvilcraft:resin",24))
    .temperature(400)
    .length(400)
    event.custom(
        {"type":"tfc:pot",
        "ingredients":[],
        "fluid_ingredient":{"ingredient":"thermal:sap","amount":100},
        "duration":200,"temperature":550,
        "item_output":[{"item":"anvilcraft:resin"},{"item":"anvilcraft:resin"}]
    })
    //烧纤维出树汁
    firmalife.vat()
    .inputItem(Item.of("anvilcraft:wood_fiber",16))
    .outputFluid(Fluid.of('thermal:sap',1000))
    .temperature(645)
    .length(800)
    event.custom(
        {"type":"tfc:pot",
        "ingredients":[{"item":"anvilcraft:wood_fiber"},{"item":"anvilcraft:wood_fiber"}],
        "fluid_ingredient":[],
        "duration":400,"temperature":645,
        "fluid_output":{"fluid":"thermal:sap","amount":100}
    })
      //磷灰石
    tfc.barrel_sealed(24000)
    .outputItem('thermal:apatite_dust')
    .inputItem(Item.of('minecraft:bone_meal',3))
    .inputFluid(Fluid.of('minecraft:water',100))
    //前期的乳胶
    tfc.barrel_sealed(86400)
    .outputFluid(Fluid.of('thermal:latex',1000))
    .inputItem(Item.of('anvilcraft:resin',32))
    .inputFluid(Fluid.of('minecraft:water',200))
    event.replaceInput({output:'tfc:sandpaper'},'ftc:sand/black','#tfc:sand')

    event.remove('anvilcraft:utusan_raw')
    firmalife.mixing_bowl()
    .fluidIngredient(Fluid.water(50))
    .itemIngredients(['minecraft:spider_eye','minecraft:pufferfish','minecraft:prismarine_crystals','minecraft:nether_wart','tfc:powder/wood_ash'])
    .outputItem(Item.of("anvilcraft:utusan_raw",2))
    event.custom(
        {"type":"tfc:pot",
        "ingredients":[{"item":"anvilcraft:utusan_raw"}],
        "fluid_ingredient":[],
        "duration":200,"temperature":200,
        "item_output":[{"item":"anvilcraft:utusan"}]
    })
    event.remove({output:'#tfc:mortar'})
    tfc.barrel_sealed(8000)
    .inputItem('#minecraft:sand')
    .outputItem('4x tfc:mortar')
    .inputFluid(Fluid.of('tfc:limewater',200))
    
    event.custom({
        "type": 'tfc:alloy',
        "contents": [
            { metal: 'kubejs:melting_high_purity_aluminum', "min":0.7,"max":0.9 },
            { metal: 'tfc:copper', "min":0.05,"max":0.3 },
            { metal: 'tfc:zinc', "min":0.05,"max":0.2 }
        ],
        "result": 'kubejs:aluminum_alloy'
    });
    //铝合金
    tfc.heating('kubejs:aluminum_alloy',400)
    .resultFluid(Fluid.of('kubejs:melting_aluminum_alloy',100))

    tfc.heating('kubejs:incompleted_andesite_alloy',800)
    .resultFluid(Fluid.of('kubejs:melting_incompleted_andesite_alloy',100))
    
    tfc.heating('kubejs:high_purity_aluminum_ingot',660)
    .resultFluid(Fluid.of('kubejs:melting_high_purity_aluminum',100))
    //把流体拿出来
    const tfcfluid = ['zinc','wrought_iron','weak_steel','weak_red_steel','weak_blue_steel','tin','sterling_silver','steel','silver','rose_gold','red_steel','pig_iron','nickel','high_carbon_steel','high_carbon_red_steel','high_carbon_blue_steel','high_carbon_black_steel','gold','copper','cast_iron','bronze','brass','blue_steel','black_steel','black_bronze','bismuth_bronze','bismuth']
    tfcfluid.forEach(item =>{
        tfc.casting(`tfc:bucket/metal/${item}`, 'kubejs:fluidbucket', TFC.fluidStackIngredient(`tfc:metal/${item}`, 1000), 1)
        create.compacting(`tfc:metal/ingot/${item}`,Fluid.of(`tfc:metal/${item}`, 100))
    })
    create.compacting(`kubejs:aluminum_alloy`,Fluid.of(`kubejs:melting_aluminum_alloy`, 100))
    create.compacting(`kubejs:high_purity_aluminum_ingot`,Fluid.of(`kubejs:melting_high_purity_aluminum`, 100))
    //先融化，再混合
    create.mixing(Fluid.of('tfc:metal/weak_steel',100),'tfc:metal/ingot/weak_steel').superheated()
    create.mixing(Fluid.of('tfc:metal/pig_iron',100),'tfc:metal/ingot/pig_iron').superheated()
    create.mixing(Fluid.of('tfc:metal/high_carbon_black_steel',100),[Fluid.of('tfc:metal/weak_steel',100),Fluid.of('tfc:metal/pig_iron',100)]).superheated()
    create.mixing(Fluid.of('tfc:metal/black_steel',100),[Fluid.of('tfc:metal/high_carbon_black_steel',100),'2x tfc:powder/flux']).superheated()
    create.mixing(Fluid.of('tfc:metal/black_steel',100),'tfc:metal/ingot/black_steel').superheated()
    create.mixing(Fluid.of('tfc:metal/weak_red_steel',100),'tfc:metal/ingot/weak_red_steel').superheated()
    create.mixing(Fluid.of('tfc:metal/high_carbon_red_steel',100),[Fluid.of('tfc:metal/weak_red_steel',100),Fluid.of('tfc:metal/black_steel',100)]).superheated()
    create.mixing(Fluid.of('tfc:metal/red_steel',100),[Fluid.of('tfc:metal/high_carbon_red_steel',100),'2x tfc:powder/flux']).superheated()
    create.mixing(Fluid.of('tfc:metal/weak_blue_steel',100),'tfc:metal/ingot/weak_blue_steel').superheated()
    create.mixing(Fluid.of('tfc:metal/high_carbon_blue_steel',100),[Fluid.of('tfc:metal/weak_blue_steel',100),Fluid.of('tfc:metal/black_steel',100)]).superheated()
    create.mixing(Fluid.of('tfc:metal/blue_steel',100),[Fluid.of('tfc:metal/high_carbon_blue_steel',100),'2x tfc:powder/flux']).superheated()

    tfc.casting('kubejs:melting_aluminum_alloy_bucket', 'kubejs:fluidbucket', TFC.fluidStackIngredient('kubejs:melting_aluminum_alloy', 1000), 1)
    tfc.casting('tfc_ie_addon:bucket/metal/aluminum', 'kubejs:fluidbucket', TFC.fluidStackIngredient('tfc_ie_addon:metal/aluminum', 1000), 1)
    tfc.casting('tfc_ie_addon:bucket/metal/uranium', 'kubejs:fluidbucket', TFC.fluidStackIngredient('tfc_ie_addon:metal/uranium', 1000), 1)
    tfc.casting('tfc_ie_addon:bucket/metal/lead', 'kubejs:fluidbucket', TFC.fluidStackIngredient('tfc_ie_addon:metal/lead', 1000), 1)
    tfc.casting('firmalife:bucket/metal/stainless_steel', 'kubejs:fluidbucket', TFC.fluidStackIngredient('firmalife:metal/stainless_steel', 1000), 1)
    tfc.casting('firmalife:bucket/metal/chromium', 'kubejs:fluidbucket', TFC.fluidStackIngredient('firmalife:metal/chromium', 1000), 1)
    tfc.casting('kubejs:melting_high_purity_aluminum_bucket', 'kubejs:fluidbucket', TFC.fluidStackIngredient('kubejs:melting_high_purity_aluminum', 1000), 1)

    event.recipes.create.compacting('kubejs:aluminum_alloy_ingot',Fluid.of(`kubejs:melting_aluminum_alloy`,100))
    event.recipes.create.compacting('immersiveengineering:ingot_aluminum',Fluid.of(`tfc_ie_addon:metal/aluminum`,100))
    event.recipes.create.compacting('immersiveengineering:ingot_uranium',Fluid.of(`tfc_ie_addon:metal/uranium`,100))
    event.recipes.create.compacting('immersiveengineering:ingot_lead',Fluid.of(`tfc_ie_addon:metal/lead`,100))
    event.recipes.create.compacting('firmalife:metal/ingot/stainless_steel',Fluid.of(`firmalife:metal/stainless_steel`,100))
    event.recipes.create.compacting('firmalife:metal/ingot/chromium',Fluid.of(`firmalife:metal/chromium`,100))
    event.recipes.create.compacting('kubejs:high_purity_aluminum_ingot',Fluid.of(`kubejs:melting_high_purity_aluminum`,100))
    event.recipes.create.compacting('kubejs:titanium_aluminum_alloy',Fluid.of(`kubejs:melting_titanium_aluminum_alloy`,100))
    //模具
    tfc.casting('kubejs:aluminum_alloy', 'tfc:ceramic/ingot_mold', TFC.fluidStackIngredient('kubejs:melting_aluminum_alloy', 100), 0.1)
    tfc.casting('kubejs:aluminum_alloy', 'tfc:ceramic/fire_ingot_mold', TFC.fluidStackIngredient('kubejs:melting_aluminum_alloy', 100), 0)
    tfc.casting('kubejs:incompleted_andesite_alloy', 'tfc:ceramic/ingot_mold', TFC.fluidStackIngredient('kubejs:melting_incompleted_andesite_alloy', 100), 0.1)
    tfc.casting('kubejs:incompleted_andesite_alloy', 'tfc:ceramic/fire_ingot_mold', TFC.fluidStackIngredient('kubejs:melting_incompleted_andesite_alloy', 100), 0)
    tfc.casting('kubejs:high_purity_aluminum_ingot', 'tfc:ceramic/ingot_mold', TFC.fluidStackIngredient('kubejs:melting_high_purity_aluminum', 100), 0.1)
    tfc.casting('kubejs:high_purity_aluminum_ingot', 'tfc:ceramic/fire_ingot_mold', TFC.fluidStackIngredient('kubejs:melting_high_purity_aluminum', 100), 0)
    
    event.shapeless('kubejs:fluidbucket','minecraft:bucket')
    event.shaped('2x firmalife:drying_mat',['AAA','ABA','AAA'],{A:"#minecraft:leaves",B:"minecraft:leather"})

    tfc.heating('chemlib:calcium_carbonate_dust',840)
    .resultItem("tfc:powder/lime")
})
TFCEvents.data(event => {
    //铝合金
    event.itemSize('kubejs:aluminum_alloy', 'normal', 'light')
    event.itemHeat('kubejs:aluminum_alloy',1.55,200,300)
    event.metal('kubejs:melting_aluminum_alloy',400,0.2,'kubejs:aluminum_alloy','#forge:double_ingots/zinc',"#forge:sheets/zinc",2,'kubejs:aluminum_alloy')
    
    event.itemSize('kubejs:high_purity_aluminum_ingot', 'normal', 'light')
    event.itemHeat('kubejs:high_purity_aluminum_ingot',1.55,300,400)
    event.metal('kubejs:melting_high_purity_aluminum',600,0.5,'kubejs:high_purity_aluminum_ingot','#forge:double_ingots/zinc',"#forge:sheets/zinc",2,'kubejs:high_purity_aluminum_ingot')
    //钛铝合金
    event.itemSize('kubejs:titanium_aluminum_alloy', 'large', 'medium')
    event.itemHeat('kubejs:titanium_aluminum_alloy',0.15,200,300)
    event.metal('kubejs:melting_titanium_aluminum_alloy',1667,0.085,'kubejs:titanium_aluminum_alloy','#forge:double_ingots/zinc',"#forge:sheets/zinc",5,'kubejs:titanium_aluminum_alloy')
    event.itemSize('kubejs:condensed_blood', 'normal', 'light')
    event.itemSize('kubejs:powder_snow_woodden_bucket', 'large', 'medium')

    event.itemSize('kubejs:incompleted_andesite_alloy', 'large', 'medium')
    event.itemHeat('kubejs:incompleted_andesite_alloy',0.6,500,800)
    event.metal('kubejs:melting_incompleted_andesite_alloy',400,0.2,'kubejs:incompleted_andesite_alloy','#forge:double_ingots/zinc',"#forge:sheets/zinc",2,'kubejs:incompleted_andesite_alloy')
})